package com.example.mobile2021606177cke04_5;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTitle;
    private ImageView ivMainLine1;
    private Button btnMainNext;
    private  boolean fanStatus=false;
    private  int[]lines;
    private  int linesID=0;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        lines = new int[6];
        lines[0]=R.drawable.line1;
        lines[1]=R.drawable.line2;
        lines[2]=R.drawable.line3;
        lines[3]=R.drawable.line4;
        lines[4]=R.drawable.line5;
        lines[5]=R.drawable.line6;
        ivMainLine1.setImageResource(lines[linesID]);
        btnMainNext.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ivMainLine1.setImageResource(lines[linesID+1]);
                linesID+=1;
            }
        });
    }

    private void initView() {
        tvMainTitle = (TextView) findViewById(R.id.tv_main_title);
        ivMainLine1 = (ImageView) findViewById(R.id.iv_main_line1);
        btnMainNext = (Button) findViewById(R.id.btn_main_next);
    }
}